#include "SMPPSourceAddrSubunit.hpp"

using namespace smpp::pdu;

SourceAddrSubunit::SourceAddrSubunit(const quint8 nValue):
TLV(TLVtags::TAG_SET_DPF,1),_Value(nValue){}

SourceAddrSubunit::SourceAddrSubunit(
const SourceAddrSubunit &nSourceAddrSubunit):
TLV(nSourceAddrSubunit),_Value(nSourceAddrSubunit.getValue()){}

bool SourceAddrSubunit::operator ==(
	const SourceAddrSubunit &nSourceAddrSubunit) const{
	return (TLV::operator == (nSourceAddrSubunit) && 
			_Value == nSourceAddrSubunit.getValue());
}

bool SourceAddrSubunit::operator !=(
	const SourceAddrSubunit &nSourceAddrSubunit) const{
	return !this->operator == (nSourceAddrSubunit);
}

SourceAddrSubunit &SourceAddrSubunit::operator = (
	const SourceAddrSubunit &nSourceAddrSubunit){
	if(*this == nSourceAddrSubunit)
		return *this;
	TLV::operator = (nSourceAddrSubunit);
	_Value = nSourceAddrSubunit.getValue();
	return *this;
}

void SourceAddrSubunit::setValue(const quint8 nValue){
	_Value = nValue;
}

const quint8 SourceAddrSubunit::getValue() const{
	return _Value;
}
